<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.1.1, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- Copyright © 1987-2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation.  A copy of
the license is included in the
section entitled "GNU Free Documentation License".

This manual contains no Invariant Sections.  The Front-Cover Texts are
(a) (see below), and the Back-Cover Texts are (b) (see below).

(a) The FSF's Front-Cover Text is:

A GNU Manual

(b) The FSF's Back-Cover Text is:

You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development. -->
<title>C++ Named Operators (The C Preprocessor)</title>

<meta name="description" content="C++ Named Operators (The C Preprocessor)">
<meta name="keywords" content="C++ Named Operators (The C Preprocessor)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">

<link href="index.html" rel="start" title="Top">
<link href="Index-of-Directives.html" rel="index" title="Index of Directives">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Predefined-Macros.html" rel="up" title="Predefined Macros">
<link href="System_002dspecific-Predefined-Macros.html" rel="prev" title="System-specific Predefined Macros">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
span:hover a.copiable-link {visibility: visible}
-->
</style>


</head>

<body lang="en">
<div class="subsection-level-extent" id="C_002b_002b-Named-Operators">
<div class="nav-panel">
<p>
Previous: <a href="System_002dspecific-Predefined-Macros.html" accesskey="p" rel="prev">System-specific Predefined Macros</a>, Up: <a href="Predefined-Macros.html" accesskey="u" rel="up">Predefined Macros</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index-of-Directives.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h4 class="subsection" id="C_002b_002b-Named-Operators-1"><span>3.7.4 C++ Named Operators<a class="copiable-link" href="#C_002b_002b-Named-Operators-1"> &para;</a></span></h4>
<a class="index-entry-id" id="index-named-operators"></a>
<a class="index-entry-id" id="index-C_002b_002b-named-operators"></a>
<a class="index-entry-id" id="index-iso646_002eh"></a>

<p>In C++, there are eleven keywords which are simply alternate spellings
of operators normally written with punctuation.  These keywords are
treated as such even in the preprocessor.  They function as operators in
&lsquo;<samp class="samp">#if</samp>&rsquo;, and they cannot be defined as macros or poisoned.  In C, you
can request that those keywords take their C++ meaning by including
<samp class="file">iso646.h</samp>.  That header defines each one as a normal object-like
macro expanding to the appropriate punctuator.
</p>
<p>These are the named operators and their corresponding punctuators:
</p>
<table class="multitable">
<tbody><tr><td>Named Operator</td><td>Punctuator</td></tr>
<tr><td><code class="code">and</code></td><td><code class="code">&amp;&amp;</code></td></tr>
<tr><td><code class="code">and_eq</code></td><td><code class="code">&amp;=</code></td></tr>
<tr><td><code class="code">bitand</code></td><td><code class="code">&amp;</code></td></tr>
<tr><td><code class="code">bitor</code></td><td><code class="code">|</code></td></tr>
<tr><td><code class="code">compl</code></td><td><code class="code">~</code></td></tr>
<tr><td><code class="code">not</code></td><td><code class="code">!</code></td></tr>
<tr><td><code class="code">not_eq</code></td><td><code class="code">!=</code></td></tr>
<tr><td><code class="code">or</code></td><td><code class="code">||</code></td></tr>
<tr><td><code class="code">or_eq</code></td><td><code class="code">|=</code></td></tr>
<tr><td><code class="code">xor</code></td><td><code class="code">^</code></td></tr>
<tr><td><code class="code">xor_eq</code></td><td><code class="code">^=</code></td></tr>
</tbody>
</table>

</div>



</body>
</html>
